import '@tarojs/async-await'
import Taro, { Component } from '@tarojs/taro'
import { Provider } from '@tarojs/redux'

import Index from './pages/index'

import configStore from './store'

import './app.scss'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
//   require('nerv-devtools')
// }

const store = configStore()

class App extends Component {

  config = {
    pages: [
      "pages/index/index",
      "pages/invitationCode/index",
      "pages/phoneLogin/index",
      "pages/design/index",
      "pages/passLogin/index",
      "pages/mine/index",
      "pages/addCare/index",
      "pages/company/index",
      "pages/companyDetail/index",
      "pages/program/index",
      "pages/collect/index",
      "pages/downLoad/index",
      "pages/subscribe/index",
      "pages/search/index",
      "pages/getvip/index",
      "pages/answerdetail/index",
      "pages/decoration/index",
      "pages/pulpitdetail/index",
      "pages/fitmentLog/index",
      "pages/bdPhone/index",
      "pages/publicNum/index",
      "pages/storeList/index",
      "pages/vipDetail/index",
      "pages/caredetail/index",
    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: 'WeChat',
      navigationBarTextStyle: 'black'
    },
    tabBar: {
      color: "#7F7F7F",
      selectedColor: "#FFAE34",
      backgroundColor: "#fff",
      borderStyle: "#E6E6E6",
      fontSize: "20px",
      list: [
        {
          pagePath: "pages/company/index",
          text: "装修公司",
          iconPath: "./asset/imgs/1.png",
          selectedIconPath: "./asset/imgs/1-selected.png"
        },
        {
          pagePath: "pages/index/index",
          text: "装修",
          iconPath: "./asset/imgs/2.png",
          selectedIconPath: "./asset/imgs/2-selected.png"
        },
        {
          pagePath: "pages/mine/index",
          text: "我的",
          iconPath: "./asset/imgs/3.png",
          selectedIconPath: "./asset/imgs/3-selected.png"
        }
      ]
    },
  }

  componentDidMount() { }

  componentDidShow() { }

  componentDidHide() { }

  componentCatchError() { }

  componentDidCatchError() { }

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return (
      <Provider store={store}>
        <Index />
      </Provider>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
